//
//  UIView+frame.m
//  01 - 彩票
//
//  Created by 晓梦影 on 16/3/27.
//  Copyright © 2016年 黄金星. All rights reserved.
//

#import "UIView+frame.h"

@implementation UIView (frame)

/** view的x*/
- (void)setX:(CGFloat )x{
    CGRect frame = self.frame;
    frame.origin.x = x;
    self.frame = frame;
}
- (CGFloat )x
{
    return self.frame.origin.x;
}

- (void)setY:(CGFloat )y{
    CGRect frame = self.frame;
    y = frame.origin.y;
    self.frame = frame;
}
- (CGFloat )y
{
    return self.frame.origin.y;
}

- (void)setWidth:(CGFloat)width{
    CGRect frame = self.frame;
    width = frame.size.width;
    self.frame = frame;
}
- (CGFloat )width
{
    return self.frame.size.width;
}

- (void)setHeight:(CGFloat)height{
    CGRect frame = self.frame;
    height = frame.size.height;
    self.frame = frame;
}
- (CGFloat )height
{
    return self.frame.size.height;
}

@end
